/*
 * jdActualizaTrataParametro.java
 *
 * Created on 24 de julio de 2008, 12:17 PM
 */

package Suministros;
import administracion.delegate.GestionPedidosDelegate;
import administracion.helper.Listas;
import administracion.helper.Utiles_MensajesDialogo;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import suministros.ejb30.entity.Parametros;

/**
 *
 * @author  Administrador
 */
public class jdActualizaTrataParametro extends javax.swing.JDialog {
    String codigo_parametro;
    javax.swing.text.MaskFormatter mascaraFecNac;
    jifAdministrarParametros padre;

    /** Creates new form jdActualizaTrataParametro */
    public jdActualizaTrataParametro(java.awt.Frame parent,
            String codparametro,jifAdministrarParametros pad) {
        super(parent,true);
        super.setTitle("Actualizacion del Parametro");
        padre=pad;
        codigo_parametro=codparametro;
        initComponents();
        
        cargarDatosParametro();
         // Formato de edici�n: ingl�s (separador decimal: el punto)
        java.text.NumberFormat editFormat = java.text.NumberFormat.getNumberInstance(java.util.Locale.ENGLISH);
        // Para la edici�n, no queremos separadores de millares
        editFormat.setGroupingUsed(false);
        // Creamos los formateadores de n�meros
        javax.swing.text.NumberFormatter enFormat = new javax.swing.text.NumberFormatter(editFormat);
        javax.swing.text.NumberFormatter enFormat2 = new javax.swing.text.NumberFormatter(editFormat);
        // Creamos la factor�a de formateadores especificando los
        // formateadores por defecto, de visualizaci�n y de edici�n
        javax.swing.text.DefaultFormatterFactory currFactory =
        new javax.swing.text.DefaultFormatterFactory(enFormat, enFormat, enFormat);
        javax.swing.text.DefaultFormatterFactory currFactory2 =
        new javax.swing.text.DefaultFormatterFactory(enFormat2, enFormat2, enFormat2);
        // El formateador de edici�n admite caracteres incorrectos
        enFormat.setAllowsInvalid(true);
        enFormat2.setAllowsInvalid(false);
        
       
        jftfParam7.setFormatterFactory(currFactory);
        jftfParam8.setFormatterFactory(currFactory);
        jftfEntero.setFormatterFactory(currFactory2);
        this.setLocationRelativeTo(null);
    }
    
    void setPadreDetalleAlmacen(jifAdministrarParametros padre){
        this.padre=padre;
    }
    void cargarDatosParametro(){
          
        ArrayList auxilio,result11;
        Parametros para=null;
        try {
            para = Listas.getParametrosID(codigo_parametro);
        } catch (Exception ex) {
            Logger.getLogger(jdActualizaTrataParametro.class.getName()).log(Level.SEVERE, null, ex);
        }
        try{
            jtfIdentificador.setText(para.getIdParametro());
        }catch(Exception res1){
        }
        try{
            jtfDescripcion.setText(para.getDescripcion());
            }catch(Exception res1){
        }
        try{
            jtfParam1.setText(para.getParam1());
            }catch(Exception res1){
        }
        try{
            jtfParam2.setText(para.getParam2());
            }catch(Exception res1){
        }
        if(para.getParam3()!=null){
            try{
            jtfParam3.setText(para.getParam3()+"");
            }catch(Exception res1){
            }
        }
       
        try{
            jtfParam4.setText(para.getParam4());
            }catch(Exception res1){
        }
        try{
            jtfParam5.setText(para.getParam5());
            }catch(Exception res1){
        }
        try{
            jftfParam7.setValue(new Double(Double.valueOf(para.getParam7()+"")));
            }catch(Exception res1){
        }
        try{
            jftfParam8.setValue(new Double(Double.valueOf(para.getParam8()+"")));
            }catch(Exception res1){
        }
        try{
            jchkParam9.setSelected(false);
            boolean val=para.getParam9();
            if (val){
                jchkParam9.setSelected(true);    
            }
            }catch(Exception res1){
        }
        try{
            jtfParam10.setText(para.getParam10());
            }catch(Exception res1){
        }
        
        try{
            jftfParamFecha.setValue(para.getFecha());
            }catch(Exception res1){
        }
        try{
            jftfEntero.setValue(para.getParamEntero());
            }catch(Exception res1){
        }
        try{
            this.jftfEntero1.setValue(para.getParamTextoLargo());
            }catch(Exception res1){
        }
        
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jtfIdentificador = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtfDescripcion = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jtfParam1 = new javax.swing.JTextField();
        jtfParam2 = new javax.swing.JTextField();
        jtfParam3 = new javax.swing.JTextField();
        jtfParam4 = new javax.swing.JTextField();
        jtfParam5 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jftfParam7 = new javax.swing.JFormattedTextField();
        jftfParam8 = new javax.swing.JFormattedTextField();
        jchkParam9 = new javax.swing.JCheckBox();
        jtfParam10 = new javax.swing.JTextField();
        try{this.mascaraFecNac = new javax.swing.text.MaskFormatter("##/##/####");
        }catch(Exception e){
            System.out.println("Error en mascara");
        }
        jftfParamFecha = new javax.swing.JFormattedTextField();
        jftfParamFecha = new javax.swing.JFormattedTextField(mascaraFecNac);

        jftfEntero = new javax.swing.JFormattedTextField();
        jbSalir = new javax.swing.JButton();
        jbtGuardar14 = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        jftfEntero1 = new javax.swing.JFormattedTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel1.setText("Identificador");

        jtfIdentificador.setFont(new java.awt.Font("Arial", 0, 12));
        jtfIdentificador.setEnabled(false);

        jLabel2.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel2.setText("Descripcion");

        jtfDescripcion.setFont(new java.awt.Font("Arial", 0, 12));

        jLabel3.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel3.setText("Parametro  1");

        jLabel4.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel4.setText("Parametro  2");

        jLabel5.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel5.setText("Parametro  3");

        jLabel6.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel6.setText("Parametro  4");

        jLabel7.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel7.setText("Parametro  5");

        jLabel8.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel8.setText("Parametro  7 (decimal)");

        jtfParam1.setFont(new java.awt.Font("Arial", 0, 12));

        jtfParam2.setFont(new java.awt.Font("Arial", 0, 12));

        jtfParam3.setFont(new java.awt.Font("Arial", 0, 12));
        jtfParam3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtfParam3ActionPerformed(evt);
            }
        });

        jtfParam4.setFont(new java.awt.Font("Arial", 0, 12));

        jtfParam5.setFont(new java.awt.Font("Arial", 0, 12));

        jLabel9.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel9.setText("Parametro  8 (decimal)");

        jLabel10.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel10.setText("Parametro  9");

        jLabel11.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel11.setText("Parametro 10");

        jLabel12.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel12.setText("Parametro Fecha");

        jLabel13.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel13.setText("Parametro Entero");

        jtfParam10.setFont(new java.awt.Font("Arial", 0, 12));

        jbSalir.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jbSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconoscomb/16x16ozygen/actions/button_cancel.png"))); // NOI18N
        jbSalir.setMnemonic('C');
        jbSalir.setText("CERRAR");
        jbSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbSalirActionPerformed(evt);
            }
        });

        jbtGuardar14.setFont(new java.awt.Font("Arial", 1, 12));
        jbtGuardar14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconoscomb/16x16ozygen/actions/button_ok.png"))); // NOI18N
        jbtGuardar14.setMnemonic('A');
        jbtGuardar14.setText("GUARDAR");
        jbtGuardar14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtGuardar14ActionPerformed(evt);
            }
        });

        jLabel14.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel14.setText("Parametro TextoLargo");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfIdentificador, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfParam1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfParam2, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfParam3, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jftfParam7, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jftfParam8)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jtfParam5, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jtfParam4, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtfParam10, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jchkParam9))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(jftfEntero))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(jftfParamFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(135, 135, 135)
                        .addComponent(jbtGuardar14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbSalir))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jftfEntero1, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jtfIdentificador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtfDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtfParam1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jtfParam2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jtfParam3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jtfParam4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jtfParam5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jftfParam7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jftfParam8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jchkParam9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jtfParam10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jftfParamFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jftfEntero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jftfEntero1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtGuardar14)
                    .addComponent(jbSalir))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jtfParam3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtfParam3ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtfParam3ActionPerformed

    private void jbSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbSalirActionPerformed
        int res = javax.swing.JOptionPane.showConfirmDialog( this,"Esta seguro de salir?",
                "Confirmar",javax.swing.JOptionPane.YES_NO_OPTION );
        if(res==javax.swing.JOptionPane.YES_OPTION){
            this.dispose();
        }
}//GEN-LAST:event_jbSalirActionPerformed

    private void jbtGuardar14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtGuardar14ActionPerformed
           // TODO add your handling code here:
       Parametros para= new Parametros();
       String fecha=null;
       int paramentero=0;
       double param7,param8;
       para.setIdParametro(codigo_parametro);
       para.setParam1(this.jtfParam1.getText());
       para.setParam10(this.jtfParam10.getText());
       para.setParam2(this.jtfParam2.getText());
       if(this.jtfParam3.getText().compareTo("")!=0){
            para.setParam3(this.jtfParam3.getText().charAt(0));
       }
      
       para.setParam4(this.jtfParam4.getText());
       para.setParam5(this.jtfParam5.getText());
       para.setContFamiliar(0);
       para.setDescripcion(this.jtfDescripcion.getText());
       para.setParamTextoLargo(jftfEntero1.getText().toString());
       try{
           fecha=jftfParamFecha.getValue().toString().trim();
           para.setFecha(new Date());
       }catch(Exception d){
           fecha=null;
       }
       try{
           paramentero=((Integer)jftfEntero.getValue()).intValue();
       }catch(Exception d){
           paramentero=0;
       }
       if(this.jftfParam7.getText().compareTo("")!=0){
           try{
           param7=((Double)jftfParam7.getValue()).doubleValue();
           }catch(Exception d){
               try{
                   param7=((Long)jftfParam7.getValue()).doubleValue();
                   para.setParam7(new BigDecimal(this.jftfParam7.getText()));
               }catch(Exception efg){
               }

           }
       }
       
       if(this.jftfParam8.getText().compareTo("")!=0){
           try{
           param8=((Double)jftfParam8.getValue()).doubleValue();
           }catch(Exception d){
               try{
                   param8=((Long)jftfParam8.getValue()).doubleValue();
                   para.setParam8(new BigDecimal(this.jftfParam8.getText()));
               }catch(Exception efg){
               }

           }
       }
       try{
          Integer.parseInt(this.jftfEntero.getText());
          para.setParamEntero(Integer.parseInt(this.jftfEntero.getText()));

       }
       catch(Exception efg){

       }

        try {
            GestionPedidosDelegate.getInstance().modificarParametro(para);
            Utiles_MensajesDialogo.mensajeExito();
            Listas.cargarParametros();
            padre.cargarDatosTabla();
        } catch (Exception ex) {
            Utiles_MensajesDialogo.mensajeError("No se pudo realizar la operacion");
            Logger.getLogger(jdActualizaTrataParametro.class.getName()).log(Level.SEVERE, null, ex);
        }

       
}//GEN-LAST:event_jbtGuardar14ActionPerformed
    
    /**
     * @param args the command line arguments
     */
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JButton jbSalir;
    public javax.swing.JButton jbtGuardar14;
    private javax.swing.JCheckBox jchkParam9;
    private javax.swing.JFormattedTextField jftfEntero;
    private javax.swing.JFormattedTextField jftfEntero1;
    private javax.swing.JFormattedTextField jftfParam7;
    private javax.swing.JFormattedTextField jftfParam8;
    private javax.swing.JFormattedTextField jftfParamFecha;
    private javax.swing.JTextField jtfDescripcion;
    private javax.swing.JTextField jtfIdentificador;
    private javax.swing.JTextField jtfParam1;
    private javax.swing.JTextField jtfParam10;
    private javax.swing.JTextField jtfParam2;
    private javax.swing.JTextField jtfParam3;
    private javax.swing.JTextField jtfParam4;
    private javax.swing.JTextField jtfParam5;
    // End of variables declaration//GEN-END:variables
    
}
